package com.springboot.springboot_demo.pool;

import sun.plugin.extension.ExtensionUtils;

import java.util.concurrent.*;

/**
 * Created by fangjicai on 2020/4/30.
 */
public class ThreadPoolTools {
    //jdk提供的线程池
 static  final  ExecutorService executorService = Executors.newCachedThreadPool();

    public static void execute(Runnable runnable){
        executorService.execute(runnable);
    }
    //自定义线程池
//    public static ThreadPoolExecutor getThreadPool(){
//        ThreadPoolExecutor pool = new ThreadPoolExecutor(10, 100, 10,
//                TimeUnit.SECONDS, new LinkedBlockingDeque<Runnable>());
//        return pool;
//    }
}
